Skip to content

o/confdbstate: handle read/writes to builtin confdbs - #17455

Open
miguelpires wants to merge 1 commit into
canonical:masterfrom
miguelpires:confdb-system-commit
Open

o/confdbstate: handle read/writes to builtin confdbs#17455
miguelpires wants to merge 1 commit into
canonical:masterfrom
miguelpires:confdb-system-commit

Conversation

@miguelpires

Copy link
Copy Markdown
Contributor

This allows reading and writing builtin confdb-schemas (i.e., those for which the account is "system"). It passes the read/write to the appropriate subsystem for commit instead of persisting databag changes. It also doesn't schedule any hooks except the observe-view hooks, since no snap can be a custodian for "system" confdbs.

https://warthogs.atlassian.net/browse/SNAPDENG-36956

@miguelpires miguelpires added the confdb confdb work (previously called registries and before aspects) label Aug 13, 2026
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.05882% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.82%. Comparing base (5769b46) to head (d6c8288).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
overlord/confdbstate/confdbmgr.go 65.21% 11 Missing and 5 partials ⚠️
overlord/confdbstate/confdbstate.go 63.63% 8 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17455      +/-   ##
==========================================
- Coverage   78.84%   78.82%   -0.02%     
==========================================
  Files        1397     1409      +12     
  Lines      197825   198157     +332     
  Branches     2502     2502              
==========================================
+ Hits       155970   156199     +229     
- Misses      32492    32575      +83     
- Partials     9363     9383      +20     
Flag Coverage Δ
unittests 78.82% <67.05%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Wed Aug 19 11:58:13 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/32239219400

Test Predictor Analysis

Preparing

Test Success %
openstack:ubuntu-24.04-64:tests/cross/go-build:arm64 🟢 99.0%
openstack:ubuntu-24.04-64:tests/cross/go-build:armhf 🟢 99.0%
openstack:ubuntu-24.04-64:tests/cross/go-build:ppc64el 🟢 99.0%
openstack:ubuntu-24.04-64:tests/cross/go-build:riscv64 🟢 99.0%
openstack:ubuntu-24.04-64:tests/cross/go-build:s390x 🟢 99.0%

Executing

Test Success %
openstack:ubuntu-26.04-64:tests/unit/go:static 🔴 11.3%

Skipped tests from snapd-testing-skip

If you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list of the below tests you wish to run (unskip plus test list must be valid yaml)

  • openstack:ubuntu-24.04-64:tests/main/i18n
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-26.04-64:tests/main/i18n
  • openstack:ubuntu-26.04-64:tests/main/interfaces-requests-activates-handlers

@pedronis pedronis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, comment and question

Comment thread confdb/confdb.go

chg := s.state.Change(chgID)
c.Assert(chg, NotNil)
c.Assert(chg.Status(), Equals, state.DoneStatus)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question, why we don't need to settle here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This falls into the path where there are no hooks to run so we just load the read data directly into the change and mark it as Done.

// no hooks to run so we can just load the values directly into the change

@miguelpires
miguelpires requested a review from pedronis August 17, 2026 09:47

@pedronis pedronis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@andrewphelpsj andrewphelpsj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread overlord/confdbstate/confdbmgr.go Outdated
@github-actions github-actions Bot added the Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system label Aug 18, 2026
This allow reading and writing builtin confdb-schemas (i.e., those for
which the account is "system"). It passes the read/write to the
appropriate subsystem for commit instead of persisting databag changes.
It also doesn't schedule any hooks except the observe-view hooks, since
no snap can be a custodian for "system" confdbs.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
@miguelpires
miguelpires force-pushed the confdb-system-commit branch from c68144b to d6c8288 Compare August 19, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system confdb confdb work (previously called registries and before aspects)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants